package com.example.springbootblog.mapper;


import com.example.springbootblog.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserInfoMapper {
    /**
     * 根据用户名获取用户信息
     * @param userName 用户名
     * @return 用户信息
     */
    @Select("select * from userinfo where user_name = #{userName} and delete_flag = 0 ")
    UserInfo queryByName(String userName);

    /**
     * 根据用户id获取用户信息
     * @param userId 用户id
     * @return 用户信息
     */
    @Select("select * from userinfo where user_id = #{userId}  and delete_flag = 0 ")
    UserInfo queryById(Integer userId);
}
